import React from 'react'
import {BrowserRouter as Router,Route,Switch,Link,Redirect,Parent} from 'react-router-dom'
import Home from './page/Home'
import Mine from './page/Mine'
import Nav from './components/Nav/Nav'
import NotFound from './components/NotFound'
import List from './page/LIst'
import User from './page/User'
import News1 from './components/News/News1'
import News2 from './components/News/News2'
export default class App extends React.Component {
    render(){
        return (
            <div>
                <h2>App</h2>
               
                <Router>
                <Nav/>
                {/* <nav>
                    <ul>
                        <li><Link to="/home">Home</Link></li>
                        <li><Link to="mine">Mine</Link></li>
                    </ul>
                </nav> */}
                    <Switch>
                    <Route strict exact  path="/home" component={Home}></Route>
                    <Route strict exact path="/mine" component={Mine}></Route>
                    <Route strict exact path="/user/:username/:id" component={User}></Route>
                    <Route strict exact path="/list" component={List}></Route>

                    <List>
                        <Switch>
                        <Route strict exact path="/list/news1" component={News1}></Route>
                        <Route strict exact path="/list/news2" component={News2}></Route>
                        <Redirect strict exact to="/list/news1"></Redirect>
                        </Switch>
                    </List>
 
                     <Redirect strict exact from="/" to="/home"></Redirect>
                     <Route strict exact component={NotFound}></Route>

                    </Switch>

                </Router>
            </div>
        )
    }
}